var metabpw_vis ={};
metabpw_vis["network"] = null;
var pathway = "cholesterol";
var searchtype_color ={"gene":"red","rxn":"blue", "met":"green"}; 
var mylayout = null;
var cywebvis = null;
var adipo_searchterm = "";
var adipocytesifdata = {};
var huvecsifdata = {};
var more_gexp = {};
var active_proj = "adipocyte";

function exportCytoscapeImage() {
    var parent_panel = 'metabpw_vis_container';
    if (cywebvis == null){
        Ext.Msg.alert("Cytoscapeweb error", "Cytoscapeweb cannot be exported until panel is not initialized");
        return;
    }
    var svg = cywebvis.svg();
    if (svg === undefined) {
        Ext.Msg.alert('SVG does not exist', 'SVG cannot be exported.');;
        return;
    }
    var pn = $("#adipo_pathways").val();
    downloadData(svg, pn + "_exported.svg", 'svg');
}

/*
miR-222 MI0000299     hsa-mir-222
miR-29a MI0000087     hsa-mir-29a
miR-27a MI0000085     hsa-mir-27a
*/
var mirna_acc = {'miR-222':'MI0000299:hsa-mir-222',
'miR-29a':'MI0000087:hsa-mir-29a',
'miR-27a':'MI0000085:hsa-mir-27a',
'miR222':'MI0000299:hsa-mir-222',
'miR29a':'MI0000087:hsa-mir-29a',
'miR27a':'MI0000085:hsa-mir-27a'};

var png_rxn = {
'57678_GPAM.png':'GPAM_hs',
'11001_FACOAL191.png':'FACOAL191',
'34_FAOXC161802m.png':'FAOXC161802m',
'35_FAOXC161802m.png':'FAOXC161802m',
'34_FAOXC80.png':'FAOXC80',
'34_FAOXC140_FAOXC150m_FAOXC160.png':['FAOXC140', 'FAOXC150m', 'FAOXC160', 'FAOXC16080m', 'FAOXC16180m', 'FAOXC170m', 'FAOXC180', 'FAOXC1811601m', 'FAOXC1811602m', 'FAOXC1811603m', 'FAOXC182806m', 'FAOXC18280m', 'FAOXC183803m', 'FAOXC183806m', 'FAOXC18480m', 'FAOXC200180m', 'FAOXC2031836m', 'FAOXC204', 'FAOXC204184m', 'FAOXC2051843m', 'FAOXC2242046m', 'FAOXC2251836m', 'FAOXC2252053m', 'FAOXC226', 'FAOXC226205m'],
'35_FAOXC80.png':'FAOXC80',
'35_FAOXC140_FAOXC150m_FAOXC160.png':['FAOXC140', 'FAOXC150m', 'FAOXC160', 'FAOXC16080m', 'FAOXC16180m', 'FAOXC180', 'FAOXC1811601m', 'FAOXC1811602m', 'FAOXC1811603m', 'FAOXC182806m', 'FAOXC18280m', 'FAOXC183803m', 'FAOXC183806m', 'FAOXC18480m', 'FAOXC200180m', 'FAOXC2031836m', 'FAOXC204', 'FAOXC204184m', 'FAOXC2051843m', 'FAOXC2242046m', 'FAOXC2251836m', 'FAOXC2252053m', 'FAOXC226', 'FAOXC226205m'],
'2180_FACOAL150_FACOAL170.png':['FACOAL150', 'FACOAL170'],
'2180_FACOAL160i_FACOAL180i_FACOAL181i_FACOAL204i.png':['FACOAL160i', 'FACOAL180i', 'FACOAL181i', 'FACOAL204i'],
'2180_FACOAL161.png':'FACOAL161',
'2180_FACOAL1812_FACOAL1813.png':['FACOAL1812', 'FACOAL1813'],
'2180_FACOAL1821_FACOAL1832_FACOAL200.png':['FACOAL1821', 'FACOAL1832', 'FACOAL200', 'FACOAL203', 'FACOAL2042', 'FACOAL2251', 'FACOAL2252', 'FACOAL240', 'FACOAL241', 'FACOAL244_1', 'FACOAL245_1', 'FACOAL245_2', 'FACOAL260'],
'2180_FACOAL1822_FACOAL204_FACOAL226.png':['FACOAL1822', 'FACOAL204', 'FACOAL226'],
'2180_FACOAL1831_FACOAL184_FACOAL205_FACOAL224_FACOAL246_1.png':['FACOAL1831', 'FACOAL184', 'FACOAL205', 'FACOAL224', 'FACOAL246_1'],
'2181_FACOAL140i_FACOAL80i.png':['FACOAL140i', 'FACOAL80i'],
'2181_FACOAL150_FACOAL170.png':['FACOAL150', 'FACOAL170'],
'2181_FACOAL160i_FACOAL180i_FACOAL181i_FACOAL204i.png':['FACOAL160i', 'FACOAL180i', 'FACOAL181i', 'FACOAL204i'],
'2182_FACOAL150_FACOAL170.png':['FACOAL150', 'FACOAL170'],
'2182_FACOAL204i.png':'FACOAL204i',
'23305_FACOAL150_FACOAL170.png':['FACOAL150', 'FACOAL170'],
'23305_FACOAL160i_FACOAL180i_FACOAL204i.png':['FACOAL160i', 'FACOAL180i', 'FACOAL204i'],
'51703_FACOAL160i_FACOAL180i.png':['FACOAL160i', 'FACOAL180i'],
'1717_DHCR71r.png':'DHCR71r',
'1717_DHCR72r.png':'DHCR72r',
'1718_DHCR241r.png':'DHCR241r',
'1718_DHCR242r.png':'DHCR242r',
'1718_DHCR243r.png':'DHCR243r',
'2224_cholesterol_rxns.png':['DMATTx', 'GRTTx'],
'2224_DMATTx_GRTTx.png':['DMATTx', 'GRTTx'],
'3155_HMGLm.png':'HMGLm',
'3155_HMGLx.png':'HMGLx',
'6307_C4STMO1r.png':'C4STMO1r',
'6307_C4STMO2r.png':'C4STMO2r',
'6309_cholesterol_rxns.png':['LSTO1r', 'LSTO2r'],
'6646_cholesterol_rxns.png':['SOAT11', 'SOAT12'],
'6646_SOAT11_SOAT12.png':['SOAT11', 'SOAT12'],
'10682_EBP1r.png':'EBP1r',
'10682_EBP2r.png':'EBP2r',
'50814_C3STDH1Pr_C3STDH1r_C4STMO2Pr_C4STMO2r.png':['C3STDH1Pr', 'C3STDH1r', 'C4STMO2Pr', 'C4STMO2r'],
'50814_cholesterol_rxns.png':['C3STDH1Pr', 'C3STDH1r', 'C4STMO2Pr', 'C4STMO2r'],
'34_ACOAD9m.png':'ACOAD9m',
'34_ACOAD10m.png':'ACOAD10m',
'586_ILETA_LEUTA_VALTA.png':['ILETA', 'LEUTA', 'VALTA'],
'587_ILETAm.png':'ILETAm',
'587_LEUTAm.png':'LEUTAm',
'587_VALTAm.png':'VALTAm',
'593_OIVD1m.png':'OIVD1m',
'593_OIVD2m.png':'OIVD2m',
'593_OIVD3m.png':'OIVD3m',
'594_OIVD1m.png':'OIVD1m',
'594_OIVD2m.png':'OIVD2m',
'594_OIVD3m.png':'OIVD3m',
'1629_OIVD1m.png':'OIVD1m',
'1629_OIVD2m.png':'OIVD2m',
'1629_OIVD3m.png':'OIVD3m',
'1738_OIVD1m.png':'OIVD1m',
'1738_OIVD2m.png':'OIVD2m',
'1738_OIVD3m.png':'OIVD3m',
'1892_ECOAH9m.png':'ECOAH9m',
'1892_ECOAH12m.png':'ECOAH12m',
'3030_ECOAH9m.png':'ECOAH9m',
'3030_ECOAH12m.png':'ECOAH12m',
'3032_ECOAH9m.png':'ECOAH9m',
'3032_ECOAH12m.png':'ECOAH12m',
'3295_C3STKR2r.png': 'C3STKR2r'}; 
